package paperockscissors;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Player {
	private String name;
	private int score;
	int currentMove;
	private List<RPSEnum> moves;
	
	public Player(String pName, List<RPSEnum> pMoves)
	{
		name = pName;
		moves = pMoves;
	}
	
	public Player(String pName)
	{
		Random rand = new Random();
		name = pName;
		moves = new ArrayList<RPSEnum>();
		for(int i=0;i<10;i++) {
			int r = rand.nextInt(3);
			
			switch(r)
			{
			case 0:
				moves.add(RPSEnum.PAPER);
				break;
			case 1:
				moves.add(RPSEnum.ROCK);
				break;
			case 2:
				moves.add(RPSEnum.SCISSORS);
				break;
			}
		}
	}
	
	public String getName() {
		return name;
	}
	
	public int getScore() {
		return score;
	}

	public int numberOfMoves() {
		return moves.size();
	}

	public RPSEnum getNextMove() {		
		return moves.get(currentMove++);
	}
	
	public void setScore(int pScore) {
		score = pScore;
	}
	
	public void reset() {
		currentMove = 0;
	}
	
}
